﻿using System.Configuration;

namespace Cos.Core.Module.Configuration
{
    public class ModuleConfigurationElementCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new ModuleConfigurationElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            var moduleElement = element as ModuleConfigurationElement;
            if (moduleElement != null)
            {
                return moduleElement.Name;
            }

            return null;
        }
    }
}